package com.xinghe.sharedevice.controller;

import com.share.common.core.web.controller.BaseController;
import com.share.common.core.web.domain.AjaxResult;
import com.xinghe.sharedevice.service.IDeviceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 星河一叶Ck
 * @date 2025/5/29
 */

@Tag(name = "设备接口管理")
@RestController
@RequestMapping("/device")
@RequiredArgsConstructor
public class DeviceController extends BaseController {

    private final IDeviceService deviceService;

    /**
     * 获取附近站点信息列表
     * @param latitude 纬度
     * @param longitude 经度
     * @return
     */
    @Operation(summary = "获取附近站点信息列表")
    @GetMapping("/nearbyStationList/{latitude}/{longitude}")
    public AjaxResult nearbyStation (@PathVariable String latitude, @PathVariable String longitude) {
        return success(deviceService.nearbyStation(latitude, longitude));
    }
}
